/**
 * 
 */
package com.nari.basic.service;

import com.nari.basic.dao.IUserRoleDao;
import com.nari.basic.model.IUserRole;
import com.nari.coreframe.service.GenericServiceImpl;

/**
 * 
 * @author Xiaopeng
 * @date 2013-7-18
 */
public class UserRoleServiceImpl extends GenericServiceImpl<IUserRole, String> 
		implements IUserRoleService {
	
	/**
	 * 通过用户唯一标识删除用户角色关联信息
	 * @param userUID
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-7-25
	 */
	public void deleteByUserUID(String userUID) throws Exception {
		IUserRoleDao iUserRoleDao = (IUserRoleDao) this.getiGenericDao();
		iUserRoleDao.deleteByUserUID(userUID);
	}
	
	/**
	 * 通过角色唯一标识删除用户角色关联信息
	 * @param roleUID
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-7-26
	 */
	public void deleteByRoleUID(String roleUID) throws Exception {
		IUserRoleDao iUserRoleDao = (IUserRoleDao) this.getiGenericDao();
		iUserRoleDao.deleteByRoleUID(roleUID);
	}
	
	/**
	 * 新增用户角色授权信息
	 * @param roleUID 角色唯一标识列表
	 * @param userUIDList 用户唯一标识列表
	 * 	格式：XXX,XXX,XXX
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-7-29
	 */
	public void saveUserRoleAuthority(String roleUID, String userUIDList) throws Exception {
		IUserRoleDao iUserRoleDao = (IUserRoleDao) this.getiGenericDao();
		iUserRoleDao.saveUserRoleAuthority(roleUID, userUIDList);
	}
	
	/**
	 * 删除用户角色授权信息
	 * @param roleUID 角色唯一标识列表
	 * @param userUIDList 用户唯一标识列表
	 * 	格式：XXX,XXX,XXX
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-7-29
	 */
	public void deleteUserRoleAuthority(String roleUID, String userUIDList) throws Exception {
		IUserRoleDao iUserRoleDao = (IUserRoleDao) this.getiGenericDao();
		iUserRoleDao.deleteUserRoleAuthority(roleUID, userUIDList);
	}
}
